home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / Devcon_Extras / HardDisk / scsidisk.i < prev   
Encoding:
Text File  |  1992-08-27  |  4.0 KB  |  112 lines

  1.     IFND    DEVICES_SCSIDISK_I
  2. DEVICES_SCSIDISK_I    EQU    1
  3. **
  4. **    $Filename: devices/scsidisk.i $
  5. **    $Revision: 1.2 $
  6. **    $Date: 88/10/13 18:08:37 $
  7. **
  8. **    SCSI exec-level device command
  9. **
  10. **    (C) Copyright 1988 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. **
  13.  
  14. ;---------------------------------------------------------------------
  15. ;
  16. ;   SCSI Command
  17. ;    Several Amiga SCSI controller manufacturers are converging on
  18. ;    standard ways to talk to their controllers.  This include
  19. ;    file describes an exec-device command (e.g. for hddisk.device)
  20. ;    that can be used to issue SCSI commands
  21. ;
  22. ;   UNIT NUMBERS
  23. ;    Unit numbers to the OpenDevice call have encoded in them which
  24. ;    SCSI device is being referred to.  The three decimal digits of
  25. ;    the unit number refer to the SCSI Target ID (bus address) in
  26. ;    the 1's digit, the SCSI logical unit (LUN) in the 10's digit,
  27. ;    and the controller board in the 100's digit.
  28. ;
  29. ;    Examples:
  30. ;          0    drive at address 0
  31. ;         12    LUN 1 on multiple drive controller at address 2
  32. ;        104    second controller board, address 4
  33. ;         88    not valid: both logical units and addresses
  34. ;            range from 0..7.
  35. ;
  36. ;   CAVEATS
  37. ;    Original 2090 code did not support this command.
  38. ;
  39. ;    Commodore 2090/2090A unit numbers are different.  The SCSI
  40. ;    logical unit is the 100's digit, and the SCSI Target ID
  41. ;    is a permuted 1's digit: Target ID 0..6 maps to unit 3..9
  42. ;    (7 is reserved for the controller).
  43. ;
  44. ;        Examples:
  45. ;          3    drive at address 0
  46. ;        109    drive at address 6, logical unit 1
  47. ;          1    not valid: this is not a SCSI unit.  Perhaps
  48. ;            it's an ST506 unit.
  49. ;
  50. ;    Some controller boards generate a unique name (e.g. 2090A's
  51. ;    iddisk.device) for the second controller board, instead of
  52. ;    implementing the 100's digit.
  53. ;
  54. ;    There are optional restrictions on the alignment, bus
  55. ;    accessability, and size of the data for the data phase.
  56. ;    Be conservative to work with all manufacturer's controllers.
  57. ;
  58. ;---------------------------------------------------------------------
  59.  
  60. HD_SCSICMD    EQU    28    ; issue a SCSI command to the unit
  61.                 ; io_Data points to a SCSICmd
  62.                 ; io_Length is sizeof(struct SCSICmd)
  63.                 ; io_Actual and io_Offset are not used
  64.  
  65.  STRUCTURE    SCSICmd,0
  66.     APTR    scsi_Data        ; word aligned data for SCSI Data Phase
  67.                 ; (optional) data need not be byte aligned
  68.                 ; (optional) data need not be bus accessable
  69.     ULONG   scsi_Length        ; even length of Data area
  70.                 ; (optional) data can have odd length
  71.                 ; (optional) data length can be > 2**24
  72.     ULONG   scsi_Actual        ; actual Data used
  73.     APTR    scsi_Command    ; SCSI Command (same options as scsi_Data)
  74.     UWORD   scsi_CmdLength    ; length of Command
  75.     UWORD   scsi_CmdActual    ; actual Command used
  76.     UBYTE   scsi_Flags        ; includes intended data direction
  77.     UBYTE   scsi_Status        ; SCSI status of command
  78.     APTR    scsi_SenseData    ; sense data: filled if SCSIF_[OLD]AUTOSENSE
  79.                 ; is set and scsi_Status has CHECK CONDITION
  80.                 ; (bit 1) set
  81.     UWORD   scsi_SenseLength    ; size of scsi_SenseData, also bytes to
  82.                 ; request w/ SCSIF_AUTOSENSE, must be 4..255
  83.     UWORD   scsi_SenseActual    ; amount actually fetched (0 means no sense)
  84.     LABEL   scsi_SIZEOF
  85.  
  86.  
  87. ;------ scsi_Flags ------
  88. SCSIF_WRITE        EQU    0    ; intended data direction is out
  89. SCSIF_READ        EQU    1    ; intended data direction is in
  90. SCSIB_READ_WRITE    EQU    0    ; (the bit to test)
  91.  
  92. SCSIF_NOSENSE        EQU    0    ; no automatic request sense
  93. SCSIF_AUTOSENSE        EQU    2    ; do standard extended request sense
  94.                     ; on check condition
  95. SCSIF_OLDAUTOSENSE    EQU    6    ; do 4 byte non-extended request
  96.                     ; sense on check condition
  97. SCSIB_AUTOSENSE        EQU    1    ; (the bit to test)
  98. SCSIB_OLDAUTOSENSE    EQU    2    ; (the bit to test)
  99.  
  100. ;------ SCSI io_Error values ------
  101. HFERR_SelfUnit        EQU    40    ; cannot issue SCSI command to self
  102. HFERR_DMA        EQU    41    ; DMA error
  103. HFERR_Phase        EQU    42    ; illegal or unexpected SCSI phase
  104. HFERR_Parity        EQU    43    ; SCSI parity error
  105. HFERR_SelTimeout    EQU    44    ; Select timed out
  106. HFERR_BadStatus        EQU    45    ; status and/or sense error
  107.  
  108. ;------ OpenDevice io_Error values ------
  109. HFERR_NoBoard        EQU    50    ; Open failed for non-existant board
  110.  
  111.     ENDC    ; DEVICES_SCSIDISK_I
  112.